import { Canvas, Controls, Meta } from '@storybook/blocks';

import * as SwitchStories from './Switch.stories';

<Meta of={SwitchStories}/>

# Switch
开关选择器

## 基本使用
<Canvas of={SwitchStories.Switch}/>
<Controls of={SwitchStories.Switch}/>

## API
<table className="api-table">
    <thead>
    <tr>
        <th>参数</th>
        <th>说明</th>
        <th>类型</th>
        <th>默认值</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>className</td>
        <td>类名class</td>
        <td>string</td>
        <td>-</td>
    </tr>
    <tr>
        <td>checked</td>
        <td>选中时的内容</td>
        <td>slot</td>
        <td>-</td>
    </tr>
    <tr>
        <td>unchecked</td>
        <td>未选中时的内容</td>
        <td>slot</td>
        <td>-</td>
    </tr>
    <tr>
        <td>defaultValue</td>
        <td>初始是否选中</td>
        <td>boolean</td>
        <td>false</td>
    </tr>
    <tr>
        <td>value</td>
        <td>当前是否选中</td>
        <td>boolean</td>
        <td>false</td>
    </tr>
    <tr>
        <td>disabled</td>
        <td>是否禁用状态</td>
        <td>boolean</td>
        <td>false</td>
    </tr>
    <tr>
        <td>loading</td>
        <td>加载中状态</td>
        <td>boolean</td>
        <td>false</td>
    </tr>
    <tr>
        <td>size</td>
        <td>控件大小</td>
        <td>`default` | `small`</td>
        <td>default</td>
    </tr>
    <tr>
        <td>onChange</td>
        <td>变化时的回调函数</td>
        <td>(value: boolean) => void</td>
        <td>-</td>
    </tr>
    </tbody>
</table>
